New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use monotonic time #160
use monotonic time #160
Conversation
Thanks! I don't suppose there is a gem that would provide this logic already, is there? It seems pretty out-of-scope for CI::Reporter to know about the underlying Ruby interpreter! Out of curiosity, did you experience any concrete problems from the use of a time source that could be monkeyed with? |
Especially if the same thing has already been copied into two other projects... |
@shepmaster there is Yes, my test suite runs -30 days and other random numbers. |
Just btw, I as a developer would pick copied code like this in my dependencies over having possibility of a version clash when trying to upgrade. Or installing another gem. |
@shepmaster this is rebased and green. I really don't think it is worth to abstract this somewhere. |
I understand your feelings, but I don't agree with them 😸 As you can tell by my long response times, this is a low-touch project, and I'm not excited to maintain ~30 lines of code that from all appearances appear to be highly specific to a given Ruby interpreter. I do agree that this kind of thing would be highly valuable. I could see accepting a PR that refactors CI::Reporter to allow injecting some kind of |
Better than having a gem dependency. But still I don't think it is acceptable default experience. Have you considered adding more maintainers to the project, so it is not just yours responsibility? |
As a compromise between the argument Would that be acceptable? |
@Bertg great! Will update the patch. Looks like there is no |
see ruby-concurrency/concurrent-ruby#256 for reasons
@shepmaster is it small enough now? It is really just getting time. |
Looks great to me 👍 |
@shepmaster I was actually planning to make this PR as well. I got inspired by this post: https://blog.dnsimple.com/2018/03/elapsed-time-with-ruby-the-right-way/ |
Looks ok to me, let's try this. |
I have never seen a PR this old get merged in. Without any sense of sarcasm: this is amazing. |
see ruby-concurrency/concurrent-ruby#256 for more information
Main reason is that your test can stub
Time
. So measuring duration of tests by that can get affected.Similar thing was resolved in cucumber 2. See cucumber/cucumber-ruby-core#101